<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>短域名生成</title>
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" type="text/css" rel="stylesheet">
    </head>
    <body>
        <div class="container-fluid mt-3">
            <h1>短域名列表</h1>
            <a href="/link/add">新建</a>
            <table class="table table-bordered ">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>URL</th>
                        <th>短域名</th>
                        <th>跳转域名</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    {{range .links}}
                       <tr>
                            <td>{{.Id}}</td>
                            <td>
                                <a href="http://{{.Url}}/{{.Shortlink}}">{{.Url}}/{{.Shortlink}}</a>
                            </td>
                            <td>{{.Shortlink}}</td>
                            <td>{{.Longlink}}</td>
                            <td>
                                <a href="/link/edit/?id={{.Id}}">编辑</a>
                                <a href="/link/delete/?id={{.Id}}">删除</a>
                            </td>
                       </tr>
                    {{end}}
                </tbody>
            </table>
        </div>
    </body>
</html>